package com.bugpool.leilema.tc.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bugpool.leilema.tc.bean.entity.SysRoleDataTree;

/**
 * @Author wh
 * @Description
 * @Date 2023/6/16 16:31
 * @Version 1.0
 **/
public interface SysRoleDataTreeMapper extends MyBaseMapper<SysRoleDataTree> {

    /**
     * 删除已经关联的 角色id绑定的 数据
     *
     * @param roleId
     */
    default void deleteByRoleId(Long roleId) {
        QueryWrapper<SysRoleDataTree> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(SysRoleDataTree::getRoleId, roleId);
        this.delete(wrapper);
    }
}
